-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wasmer compile
command for non-x86 target
#3185
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syrusakbary
approved these changes
Sep 14, 2022
On point! Thanks for the fix! |
flfymoss
force-pushed
the
fix-compile-command-for-arm
branch
from
September 15, 2022 01:07
5cdfe18
to
43e5407
Compare
Ah sorry, I've fixed build issue (missing import) on cli-compiler. |
bors r+ |
bors bot
added a commit
that referenced
this pull request
Sep 15, 2022
3185: Fix `wasmer compile` command for non-x86 target r=syrusakbary a=flfymoss <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description <!-- Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> Currently, `wasmer compile` command with specifying non-x86 (e.g. `aarch64-apple-darwin`) target doesn't work. This change fixes the issue by not SSE2 to be force added for non-x86 targets. (Codes are ported from https://github.com/wasmerio/wasmer/blob/8a6c98702f1b8b63f5ab3d1b8c094959dd325afe/lib/cli/src/commands/create_obj.rs#L80 and https://github.com/wasmerio/wasmer/blob/d4a888abed6d877d46bf040a932e693ab39940b9/lib/cli/src/commands/create_exe.rs#L151 ) Possibly relates #2760 (comment) ## Demo ### Before ```sh $ wasmer compile hello.wasm -o hello.wasmu Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu Hello World! $ wasmer compile --target aarch64-apple-darwin -o hello.wasmu hello.wasm Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu error: failed to run `hello.wasmu` │ 1: failed to instantiate WASI module ╰─▶ 2: missing required CPU features: "EnumSet(SSE2)" ``` ### After ```sh $ wasmer compile --target aarch64-apple-darwin -o hello.wasmu hello.wasm Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu Hello World! ``` # Review - [ ] Add a short description of the change to the CHANGELOG.md file Co-authored-by: Go Murakami <[email protected]>
Build failed: |
flfymoss
force-pushed
the
fix-compile-command-for-arm
branch
from
September 15, 2022 04:13
43e5407
to
26848ef
Compare
I've also fixed code style. All other tests have passed, so I think it's all OK now. |
bors r+ |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently,
wasmer compile
command with specifying non-x86 (e.g.aarch64-apple-darwin
) target doesn't work.This change fixes the issue by not SSE2 to be force added for non-x86 targets.
(Codes are ported from
wasmer/lib/cli/src/commands/create_obj.rs
Line 80 in 8a6c987
wasmer/lib/cli/src/commands/create_exe.rs
Line 151 in d4a888a
Possibly relates #2760 (comment)
Demo
Before
After
Review